<div id="catalog-wrap">
    <?= $this->catalog()->header(Application_Model_Factory::CATALOG_RENT_GOOD, $this->category); ?>
    <br/>
    <a href="/admin/create/rent/">Добавить</a>
    <br/>
    <div id="catalog-goods-wrap">
        <div id="catalog-list">
            <div id="goods-list-wrap">
               <table id="rent-list">
                    <thead>
                        <tr>
                            <th class="edit">Действия</th>
                            <th class="photo">Фото</th>
                            <th class="description">Название</th>
                            <th class="price">1 день <br/><small>(руб/сут)</small></th>
                            <th class="price">2 дня<br/><small>и более</small><br/><small>(руб/сут)</small></th>
                            <th class="bail">Залог <br/><small>(руб)</small></th>
                        </tr>
                    </thead>
                    <tbody>
                    <? foreach ($this->instruments as $element):?>
                        <?/** @var $element Application_Model_Rent */?>

                        <tr id="id-<?= $element->getId(); ?>">
                            <td>
                                <a href="/admin/edit/rent?id=<?= $element->getId(); ?>">Редактировать</a>
                                <br/>
                                <br/>
                                <a href="/admin/delete/rent?id=<?= $element->getId(); ?>">Удалить</a>
                            </td>
                            <td class="photo">
                                <img src="<?= $element->getIconUrl(); ?>" />
                            </td>
                            <td class="description">
                                <span class="info-text">
                                    <?= $element->getTitle(); ?>
                                </span>
                            </td>
                            <td class="price"><?= $element->getRentPrice(); ?></td>
                            <td class="price"><?= $element->getRentPriceMore(); ?></td>
                            <td class="bail"><?= $element->getRentBail(); ?></td>
                        </tr>
                    <? endforeach; ?>
                    </tbody>
                </table>
            </div>
         </div>
     </div>
 </div>
<script type="text/javascript">
    $(document).ready(function() {
        $('#rent-list').tableDnD({
            onDrop : function (table, row) {
                $.get('/admin/savesort', $.tableDnD.serialize());
            }
        });
    });
</script>